<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/8
 * Time: 10:01
 */
namespace app\admin\model;

use think\Model;

class Smssign extends Model
{
    protected $table = 'sw_sms_signature';
    //自动写入时间戳
    protected $autoWriteTimestamp = false;
    // 定义类型转换
    /*protected $type = [
        'birthday'    => 'timestamp:Y/m/d',
    ];*/
    // 定义自动完成的属性
    protected $insert             = [
        'status'=>0,
    ];

    protected $field = [];

    // status属性读取器
    protected function getStatusAttr($value)
    {
        $status = [0 => '禁用', 1 => '正常',];
        return $status[$value];
    }
    // 定义关联方法
    public function client()
    {
        return $this->belongsTo('Client','client_id','id')->bind('name');
    }
}